﻿using UnityEngine;
using System.Collections;

public class acceleratorSpeed : MonoBehaviour {

	ShipController2 cShip;
	GateManager gateManager;

	// Use this for initialization
	void Start () {
		GameObject player = GameObject.Find("Player");
		cShip = player.GetComponent("ShipController2") as ShipController2;
		GameObject gateManagerObject = GameObject.Find("GateManagerObject");
		gateManager = gateManagerObject.GetComponent("GateManager") as GateManager;
	
	}
	
	// Update is called once per frame
	void Update () {

	
	}

	void OnTriggerEnter(Collider col)
	{
		if(col.gameObject.tag =="Player")
		{
			cShip.Boost();
			gateManager.NextGate();
		}

	}
}
